<@_content id=id>
	<#assign a=object/>
	<#assign id=a.id/>
	<#assign parentId=a.parentId!/>
	<#assign categoryId=a.categoryId!/>
	<#assign modelId=a.modelId!/>
	<#assign attribute=getContentAttribute(a.id)!/>
</@_content>
<@_category id=categoryId!><#assign category=object/></@_category>
<@_model id=modelId!><#assign model=object/></@_model>
<script>
function clickAddTag(){
	$('.tags .button').click();
}
</script>
<div class="pageContent">
	<form method="post" action="cmsContent/save.do?callbackType=closeCurrent&navTabId=cmsContent/list" class="pageForm required-validate" onsubmit="clickAddTag(); return validateCallback(this,navTabAjaxDone);">
		<input name="id" type="hidden" value="${id!}" />
		<input name="parentId" type="hidden" value="${parentId!}" />
		<div class="pageFormContent" layoutH="57">
		<@_content id=parentId>
			<dl class="nowrap">
				<dt>父内容:</dt>
				<dd>
					${(object.title)!}
				</dd>
			</dl>
		</@_content>
			<dl>
				<dt>分类:</dt>
				<dd>
					<input name="categoryId" type="hidden" value="${categoryId!}"/>
					${(category.name)!}
				</dd>
			</dl>
			<dl>
				<dt>模型:</dt>
				<dd>
					<input name="modelId" type="hidden" value="${modelId!}"/>
					${(model.name)!}
				</dd>
			</dl>
			<dl class="nowrap">
				<dt>标题:</dt>
				<dd>
					<input class="required" name="title" type="text" maxlength="255" size="60" value="${(a.title)!}"/>
					<#if !model?has_content||!model.onlyUrl><label><input name="copied" type="checkbox" onclick="if($(this).is(':checked')){$('.copied').show();}else{$('.copied').hide();$('.copied input[type=text]',navTab.getCurrentPanel()).val('');}"/>转载</label></#if>
				</dd>
			</dl>
			<dl class="copied" style="display:none">
				<dt>来源:</dt>
				<dd><input name="source" type="text" maxlength="50" size="20" value="${(attribute.source)!}"/></dd>
			</dl>
			<dl class="copied" style="display:none">
				<dt>来源网址:</dt>
				<dd><input class="url" name="sourceUrl" type="text" maxlength="255" size="20" value="${(attribute.sourceUrl)!}"/></dd>
			</dl>
		<#if a?has_content&&a.copied>
			<script>
				$('input[name=copied]',navTab.getCurrentPanel()).click();
			</script>
		</#if>
		<#if model?has_content&&model.onlyUrl>
			<dl class="nowrap">
				<dt>网址:</dt>
				<dd>
					<input name="onlyUrl" type="hidden" value="true" />
					<input name="url" type="text" maxlength="1000" style="width: 100%;" value="${(a.url)!}"/>
				</dd>
			</dl>
		<#else>
			<dl>
				<dt>作者:</dt>
				<dd><input name="author" type="text" maxlength="50" size="20" value="${(a.author)!}"/></dd>
			</dl>
			<dl>
				<dt>编辑:</dt>
				<dd><input name="editor" type="text" maxlength="50" size="20" value="${(a.editor)!}"/></dd>
			</dl>
			<#include "../include_page/tags.html"/>
			<#assign typeIds=category.tagTypeIds!''/>
			<#assign tagIds=(a.tagIds)!''/>
			<@tags typeIds tagIds/>
		</#if>
			<dl class="nowrap">
				<dt>描述:</dt>
				<dd><textarea name="description" maxlength="300" style="width: 100%;" rows="5">${(a.description)!}</textarea></dd>
			</dl>
		<#if !model?has_content||!model.onlyUrl>
			<dl class="nowrap">
				<dt>正文:</dt>
				<dd style="width:800px">
					<textarea name="text" class="required editor" style="width: 100%;" rows="20">${(attribute.text?html)!}</textarea>
				</dd>
			</dl>
		</#if>
			<dl>
				<dt>定时发布:</dt>
				<dd>
					<input name="timing" type="checkbox" onclick="if($(this).is(':checked')){$('#publishDate',navTab.getCurrentPanel()).show();$('input[name=publishDate]',navTab.getCurrentPanel()).addClass('required').addClass('valid')}else{$('#publishDate',navTab.getCurrentPanel()).hide();$('input[name=publishDate]',navTab.getCurrentPanel()).removeClass('required').removeClass('valid')}"/>
				</dd>
			</dl>
			<dl id="publishDate" style="display:none">
				<dt>发布日期:</dt>
				<dd>
					<input class="date" name="publishDate" type="text" size="20" dateFmt="yyyy-MM-dd HH:mm:ss" value="${(a.publishDate)!}"/>
					<a class="inputDateButton" href="javascript:;">选择</a>
				</dd>
			</dl>
		<#if a?has_content&&a.publishDate gt .now>
			<script>
				$('input[name=timing]',navTab.getCurrentPanel()).click();
			</script>
		</#if>
			<dl class="nowrap">
				<dt>封面:</dt>
				<dd>
					<input name="cover" value="${(a.cover)!}" maxlength="300" size="40" type="text"/>
					<a class="btnAttach" href="common/upload.html?field=cover&onlyImage=true" lookupGroup="" width="560" height="300">图片</a>
					<#include "../include_page/preview.html"/>
					<@preview 'content' 'input[name=cover]'/>
				</dd>
			</dl>
<#include "../include_page/extendData.html"/>
<#if category?has_content&&category.extendId?has_content>
	<@_sysExtendFieldList extendId=category.extendId>
		<@extendData 'categoryExtendDataList' page.list attribute!{}/>
	</@_sysExtendFieldList>
</#if>
<#if model?has_content&&model.extendId?has_content>
	<@_sysExtendFieldList extendId=model.extendId>
		<@extendData 'modelExtendDataList' page.list attribute!{}/>
	</@_sysExtendFieldList>
</#if>
		<#include "../include_page/related.html"/>
		<@related id!/>
<#if model?has_content&&(model.hasImages||model.hasFiles)>
	<#include "../include_page/contentFiles.html"/>
	<#if model.hasImages>
		<@contentFiles true id!/>
	</#if>
	<#if model.hasFiles>
		<@contentFiles false id!/>
	</#if>
</#if>
		</div>
		<div class="formBar">
			<ul>
				<li>
					<label><input type="checkbox" name="draft" />保存为草稿</label>
				</li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
</div>